const Sequelize = require('sequelize'); //引入Sequelize模块
const db = require('../db');

//定义model
const Student = db.define('Student',{
    //主键
    id:{type:Sequelize.BIGINT,primaryKey:true,allowNull:false },
    //账号
    username:{type:Sequelize.STRING(16),allowNull:false },
    //密码
    password:{type:Sequelize.STRING(16),allowNull:false },
    //班级
    class:{type:Sequelize.STRING(10),allowNull:false },
    //姓名
    studentname:{type:Sequelize.STRING(5),allowNull:false },
    //角色
    role:{type:Sequelize.STRING(10),allowNull:false },
    //创建时间
    createdAt:{ type:Sequelize.DATE },
    //修改时间
    updatedAt:{ type:Sequelize.DATE }
}, {
        underscored:true,
        tableName:'student',
});

module.exports = Student;